package com.tzbank.wisdom.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.tzbank.wisdom.service.FinanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


/**
 * 理财控制器
 *
 */
@Api(tags = { "理财控制器" })
@RequestMapping("finance")
@RestController
public class FinanceController {

	@Autowired
	private FinanceService financeService;

	/**
	 * 
	 * 理财产品清单列表查询
	 * @param reqBody
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/getFinanceAll")
	@ApiOperation(value = "理财产品清单列表查询", notes = "理财产品清单列表查询接口")
	public Map<String, Object> getFinanceAll(@RequestBody Map<String, String> reqBody) {
		return financeService.getFinanceAll(reqBody);
	}

	/**
	 * 
	 * 理财-理财产品详情查询
	 * @param reqBody
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/getFinanceDetail")
	@ApiOperation(value = "理财产品详情查询", notes = "理财产品详情查询接口")
	public Map<String, Object> getFinanceDetail(@RequestBody Map<String, String> reqBody) {
		return financeService.getFinanceDetail(reqBody);
	}

		
	/**
	 * 客户购买的理财产品列表查询
	 * 
	 * @param reqBody
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/buyFinanceList")
	@ApiOperation(value = "客户购买的理财产品列表查询", notes = "客户购买的理财产品列表查询接口")
	public Map<String, Object> buyFinanceList(@RequestBody Map<String, String> reqBody) {
		return financeService.buyFinanceList(reqBody);
	}
	
	/**
	 * 理财产品购买
	 * 
	 * @param reqBody
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/buy")
	@ApiOperation(value = "理财产品购买", notes = "理财产品购买接口")
	public Map<String, Object> buy(@RequestBody Map<String, String> reqBody) {
		return financeService.buy(reqBody);
	}
	
	/**
	 * 认购取消
	 * 
	 * @param reqBody
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/cancelBuy")
	@ApiOperation(value = "认购取消", notes = "认购取消接口")
	public Map<String, Object> cancelBuy(@RequestBody Map<String, String> reqBody) {
		return financeService.cancelBuy(reqBody);
	}
	
	/**
	 * 赎回
	 * 
	 * @param reqBody
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/redeem")
	@ApiOperation(value = "赎回", notes = "赎回接口")
	public Map<String, Object> redeem(@RequestBody Map<String, String> reqBody) {
		return financeService.redeem(reqBody);
	}
	
	
	/**
	 * 赎回取消
	 * 
	 * @param reqBody
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/cancelRedeem")
	@ApiOperation(value = "赎回取消", notes = "赎回取消接口")
	public Map<String, Object> cancelRedeem(@RequestBody Map<String, String> reqBody) {
		return financeService.cancelBuy(reqBody);
	}
	
	/**
	 * 客户持有理财产品查询(05003000011)
	 * LLZ
	 * @param reqBody
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/myProductAll")
	@ApiOperation(value = "客户持有理财产品查询", notes = "客户持有理财产品查询接口")
	public Map<String, Object> myProductAll(@RequestBody Map<String, String> reqBody) {
		return financeService.myProductAll(reqBody);
	}
	
	/**
	 * 客户风险等级查询
	 * 
	 * @param reqBody
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/getUserLevel")
	@ApiOperation(value = "客户风险等级查询", notes = "客户风险等级查询接口")
	public Map<String, Object> getUserLevel(@RequestBody Map<String, String> reqBody) {
		return financeService.getUserLevel(reqBody);
	}
	
	/**
	 * 客户风险等级提交
	 * 
	 * @param reqBody
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/levelConfirm")
	@ApiOperation(value = "客户风险等级提交", notes = "客户风险等级提交接口")
	public Map<String, Object> levelConfirm(@RequestBody Map<String, String> reqBody) {
		return financeService.levelConfirm(reqBody);
	}
	
	/**
	 * 理财签约
	 * 
	 * @param reqBody
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/sign")
	@ApiOperation(value = "理财签约", notes = "理财签约接口")
	public Map<String, Object> sign(@RequestBody Map<String, String> reqBody) {
		return financeService.sign(reqBody);
	}
	
	/**
	 * 理财签约查询
	 * 
	 * @param reqBody
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/querySign")
	@ApiOperation(value = "理财签约查询", notes = "理财签约查询接口")
	public Map<String, Object> querySign(@RequestBody Map<String, String> reqBody) {
		return financeService.querySign(reqBody);
	}
	
	/**
	 * 热门理财列表
	 * 
	 * @param reqBody
	 * @return
	 */
	@ResponseBody
	@PostMapping(value = "/getFinanceHot")
	@ApiOperation(value = "热门理财列表", notes = "热门理财列表接口")
	public Map<String, Object> getFinanceHot(@RequestBody Map<String, String> reqBody) {
		return financeService.getFinanceHot(reqBody);
	}
	
}
